<html>

<head>
    <title></title>
    <meta name="wechat-enable-text-zoom-em" content="true">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta charset="UTF-8" name="description" content="">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="color-scheme" content="light dark">
    <meta name="viewport"
        content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0,viewport-fit=cover">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <meta name="referrer" content="origin-when-cross-origin">
    <meta name="referrer" content="strict-origin-when-cross-origin">
    <script src="https://push.baidu.com/static/js/libs/jquery-2.0.3.js"></script>
    <style>
        * {
            padding: 0;
            margin: 0;
        }
        body {
            width: 100%;
            height: 100vh;
            background: #fff;
            overflow: hidden;
        }
        .ssl_tips_container {
            display: flex;
            justify-content: center;
            padding: 15px 0;
        }
        .ssl_tips {
            display: flex;
            align-items: center;
        }
        .ssl_logo {
            width: 20px;
            margin-right: 3px;
        }
        .ssl_logo img {
            width: 16px;
            height: 16px;
            margin: 2px 2px;
        }
        .ssl_text {
            flex: 1;
            font-size: 14px;
            color: #999;
        }
        .jump_gif {
            width: 50%;
            margin: 50px auto 0;
        }
        .jump_gif img {
            width: 100%;
        }
        .jump_text {
            text-align: center;
            font-size: 16px;
            color: #666;
            margin-top: 80px;
        }
        .jump_button_tips {
            text-align: center;
            color: #ccc;
            margin-top: 10px;
            font-size: 15px;
        }
        .jump_button {
            width: 45%;
            height: 45px;
            line-height: 45px;
            text-align: center;
            color: #fff;
            background: rgb(6, 201, 100);
            border-radius: 10px;
            margin: 20px auto 0;
            font-size: 16px;
        }
        .a-jump {
            text-decoration: none;
            -webkit-tap-highlight-color:rgba(255,0,0,0);
        }
        .powerby {
            position: fixed;
            bottom: 20px;
            left: 0;
            right: 0;
            margin: 0 auto;
            color: #ccc;
            font-size: 13px;
            text-align: center;
        }
        .error {
            width: 80%;
            text-align: center;
            font-size: 14px;
            color: #666;
            margin: 50px auto 0;
        }
        .bg {
            width: 100%;
        }

        .bg img {
            width: 100%;
        }

        .btu a {
            display: inline-block;
            /* 设置为块级元素，以便设置宽度和高度 */
            padding: 5px 20px;
            /* 设置内边距，增加点击区域 */
            text-decoration: none;
            /* 去掉下划线 */
            background-color: #ccc;
            /* 设置背景颜色 */
            color: #000;
            /* 设置文本颜色 */
            border: none;
            /* 去掉边框 */
            width: 100px;
            /* 设置按钮宽度 */
            height: 30px;
            /* 设置按钮高度 */
            text-align: center;
            /* 文本居中 */
            line-height: 30px;
            /* 行高等于按钮高度，使文本垂直居中 */
            border-radius: 30px;
            margin-top: 20px
        }
    </style>
</head>

<body>

    <div id="oldbox" style="display: none;">
        <div style="position:fixed;top: 10px;width: 100%;display: flex;align-items: center;justify-content: center;">
            <img id="imageing"
                src=""
                alt="" style="width:20px;height:20px;">
            <span style="color:rgb(144,147,153)">
                该链接经过<span style="color:#67C23A;">SSL安全加密</span>,请放心点击
            </span>
        </div>
        <div class="jump_gif"><img src="https://saas.11811.cn/zndl/jumpwx.gif" /></div>
        <div class="jump_text">正在跳转至微信...</div>
        <div class="jump_button_tips">如没有自动跳转请点击按钮跳转</div>
        
        <div class="jump_button" id="open">
            点击跳转
        </div>
        <!--<div style="text-align: center;font-size: 15px;margin-top: 10px;color: gray;">无法打开时,使用默认浏览器打开。-->
        <!--    <span id="copy" style="color: rgb(41, 86, 202);cursor: pointer;">复制链接</span>-->
        <!--</div>-->
    </div>
    <div id="newbox" style="display: none;">

    </div>
    <div id="app"></div>

    <script>
        // var vConsole = new VConsole();
        var currentURL = window.location.href;
        var url = new URL(currentURL);
        const copySpan = document.getElementById("copy");
        const openSpan = document.getElementById("open");
        const oldbox = document.getElementById("oldbox");
        const newbox = document.getElementById("newbox");
        var link = ""
        var lastSixChars = url.searchParams.get("vid");
        var is_tem = 0
        var tem_img = ""
        var urlprefix = 'https://saas.11811.cn';
        var script = document.createElement('script');
        script.src = urlprefix + '/zndl/jquery.min.js';
        document.head.appendChild(script);
        var img = urlprefix + "/zndl/safe.png"
        const imageing = document.getElementById("imageing");
        imageing.src = img
        var ajax_url = urlprefix + "/zndl/api/Redirect/GetCardInfo?code=" + lastSixChars;
        if (lastSixChars) {
            $.ajax({
                url: ajax_url,
                dataType: "jsonp",
                jsonpCallback: "handleJSONPResponse",
                success: function (res) {
                    if (res.is_tem == 0 || res.is_tem == null) {
                        oldbox.style.display = "block"
                    } else {
                        newbox.style.display = "block"
                        var newImg = document.createElement("img");
                        newImg.id = "newimg";
                        newImg.src = res.tem_img;
                        newImg.style.width = "100%"
                        var newBox = document.getElementById("newbox");
                        newBox.appendChild(newImg);
                    }
                    if (res.code == 200) {
                        if (res.title == '外链过期' && res.plain_url == '') {
                            alert("外链链接已过期！");
                            return false
                        }
                        const jw_title = res.title;
                        const jw_icon = res.img;
                        $("title").text(jw_title);
                        var metaDescription = document.querySelector('meta[name="description"]');
                        metaDescription.setAttribute('content', res.content);
                        var shortcutIconLink = $("<link>");
                        shortcutIconLink.attr("rel", "shortcut icon");
                        shortcutIconLink.attr("href", jw_icon);
                        $("head").append(shortcutIconLink);
                        var url = res.plain_url;
                        link = url
                        $('#app').html(
                            '<a href="' + url + '" id="" >' +
                            '   ' +
                            '</a>' +
                            '<iframe src="' + url + '" style="display:none;"></iframe>'
                        );
                    } else if (res.code == 201) {
                        const jw_title = res.title;
                        const jw_icon = res.img;
                        $("title").text(jw_title);
                        var metaDescription = document.querySelector('meta[name="description"]');
                        metaDescription.setAttribute('content', res.content);
                        var shortcutIconLink = $("<link>");
                        shortcutIconLink.attr("rel", "shortcut icon");
                        shortcutIconLink.attr("href", jw_icon);
                        $("head").append(shortcutIconLink);
                        var url = res.plain_url;
                        link = url;
                        $('#app').html(
                            '<a href="' + url + '" id="" >' +
                            '   ' +
                            '</a>' +
                            '<iframe src="' + url + '" style="display:none;"></iframe>'
                        );
                    } else if (res.code == 0) {
                        alert(res.title);
                    }

                },
            });
        } else {
            alert("卡片链接错误！");
        }
        newbox.addEventListener("click", function () {
            window.location.href = link
        });
        openSpan.addEventListener("click", function () {
            window.location.href = link
        });
        copySpan.addEventListener("click", function () {
            var noturl = window.location.href;
            const parts = noturl.split("&", 2);
            const result = parts[0];
            const part2 = parts[1];
            const textarea = document.createElement("textarea");
            textarea.value = result;
            document.body.appendChild(textarea);
            textarea.select();
            document.execCommand("copy");
            document.body.removeChild(textarea);
            alert("复制成功！");
        });
            // } else {  
            //     alert('请在抖音中打开')  
            // }
    </script>
</body>

</html>